//
//  WaterfallCollectionViewCell.m
//  Mall
//
//  Created by 孙飞燕 on 16/10/10.
//  Copyright © 2016年 孙飞燕. All rights reserved.
//

#import "WaterfallCollectionViewCell.h"

@implementation WaterfallCollectionViewCell
- (UIImageView *)waterfallImage{
    if (!_waterfallImage) {
        _waterfallImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - 20)];
        [self.contentView addSubview:_waterfallImage];
    }
    //由于cell的重用机制和每个的cell的高度不统一，所以每次我们在使用imageview的时候，都需要改变imageView的frame，并且在这里，imageView的位置和大小与cell一致。
//    _waterfallImage.frame=self.bounds;
    return _waterfallImage;
}
- (UILabel *)waterfallLabel{
    if (!_waterfallLabel) {
        _waterfallLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, self.frame.size.height - 20, self.frame.size.width - 10, 20)];
        [self.contentView addSubview:_waterfallLabel];
    }
    return _waterfallLabel;
}
@end
